<?php

// Define path to root directory
defined('ROOT_PATH')
    || define('ROOT_PATH', realpath(dirname(__FILE__) . '/..'));

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Define path to templates directory
defined('TEMPLATE_PATH')
    || define('TEMPLATE_PATH', APPLICATION_PATH . '/views/templates');

// Define path to templates directory
defined('TEMPLATE_CACHE_PATH')
    || define('TEMPLATE_CACHE_PATH', APPLICATION_PATH . '/views/cache');

// Define path to template scripts directory
defined('TEMPLATE_SCRIPT_PATH')
    || define('TEMPLATE_SCRIPT_PATH', APPLICATION_PATH . '/views/scripts');

// Define the flag of template file refresh check
defined('TEMPLATE_REFRESH_CHECK')
    || define('TEMPLATE_REFRESH_CHECK', false);

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
//$bootstrap = $application->getBootstrap();
//require_once 'Soooner/Plugin/Acl.php';
//$bootstrap->registerPluginResource(new Soooner_Plugin_Acl());
$application->bootstrap()
            ->run();